﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Business.Abstract;
using Business.Service;
using PresentationMVC.Models;
using Domain.Entity;

namespace PresentationMVC.Controllers
{
    public class CreateInvoiceController : Controller
    {
        //
        // GET: /Invoice/

        public ActionResult Index()
        {
            IInvoiceService srv = new InvoiceServiceImpl();
            IList<Invoice> lst = srv.GetAllInvoices();
            InvoiceDataModel model = new InvoiceDataModel();
            model.Invoice = new Invoice();
            model.AllInvoice = lst;
            return View(model);
        }

        public ActionResult GridviewSearch(InvoiceDataModel model)
        {
            IInvoiceService srv = new InvoiceServiceImpl();
            IList<Invoice> lst = srv.GetAllInvoices();
            model.Invoice = new Invoice();
            model.AllInvoice = lst;
           
            this.ViewData.Model = model;
            return PartialView("InvoiceGridPartial");
        }

        public ActionResult CreateInvoice()
        {

            return View();
        }
    }
}
